ref: dead-code and duplication cleanup#843
Merged
Merged
Conversation
The run-footer time formatter open-coded the same ms -> Xm Ys / X.XXs / Xms branching already provided by bashunit::console_results::format_duration. Since print_execution_time runs once per run (not on the per-test hot path), delegate to the shared helper instead of re-deriving the logic. Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
The stdout-returning tag wrapper had zero production callers: runner.sh uses the fork-free build_tags_map + tags_for_function pair directly. Only its own unit tests exercised it. Remove the wrapper and its 4 tests, keeping the tags path singular. function_matches_tags tests remain. Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
Drop 9 internal getters/resets that had zero call sites anywhere in the tracked repo (proven via git grep; no dynamic dispatch, not part of the public assertion/CLI API). The backing _BASHUNIT_* variables are read and written directly, so these accessors were dead: - bashunit::state::get_test_exit_code - bashunit::state::get_test_title - bashunit::state::get_current_test_interpolated_function_name - bashunit::state::get_test_hook_failure / reset_test_hook_failure - bashunit::state::get_test_hook_message / reset_test_hook_message - bashunit::state::is_assertion_failed_in_test - bashunit::clock::total_runtime_in_nanoseconds Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
A multi-agent audit swept the codebase across eight quality axes (DRY, shared constants, dead code, source cycles, fragile constructs, error-hiding defensive code, legacy/fallback code, comment slop). Five axes were already clean; three surfaced provably-safe removals.
💡 Changes
format_durationhelper inprint_execution_timeinstead of open-coding the same ms→Xm Ys/X.XXs/Xmsbranching (branch-equivalence verified at the 1000/60000 ms boundaries; off the per-test hot path).get_tags_for_functionstdout wrapper and its 4 tests —runner.shuses the fork-freebuild_tags_map+tags_for_functionpair directly, leaving zero production callers._BASHUNIT_*vars are read/written directly).Internal only — no user-facing behavior change, so no CHANGELOG entry. Full gate green: sequential +
--parallel --simple --strict(1380 passed),make sa,make lint,./build.sh --verify.https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED